package com.yjs.ppjokedemo.viewmodel;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;

import com.yjs.ppjokedemo.bean.LikedItem;
import com.yjs.ppjokedemo.bean.RecomProduct;
import com.yjs.ppjokedemo.repo.LikedRepo;
import com.yjs.ppjokedemo.repo.RecomRepo;

import java.util.List;

public class RecomViewModel extends ViewModel {

    RecomRepo mRecomRepo = new RecomRepo();
    LikedRepo mLikedRepo = new LikedRepo();

    public LiveData<List<RecomProduct>> getRecomProducts(){
        return mRecomRepo.getProducts();
    }


    public LiveData<List<LikedItem>> getLiked(){
        return mLikedRepo.getLiked();
    }
    public boolean addProductToLiked(RecomProduct recomProduct){
        return mLikedRepo.addItemToLiked(recomProduct);
    }
}
